package com.tudouji.project.mt.service.impl;

import java.util.List;
import com.tudouji.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tudouji.project.mt.mapper.MtFoodconsumgoodsitemMapper;
import com.tudouji.project.mt.domain.MtFoodconsumgoodsitem;
import com.tudouji.project.mt.service.IMtFoodconsumgoodsitemService;

/**
 * 美团菜品消耗单物料明细Service业务层处理
 * 
 * @author tudouji
 * @date 2023-11-21
 */
@Service
public class MtFoodconsumgoodsitemServiceImpl implements IMtFoodconsumgoodsitemService 
{
    @Autowired
    private MtFoodconsumgoodsitemMapper mtFoodconsumgoodsitemMapper;

    /**
     * 查询美团菜品消耗单物料明细
     * 
     * @param id 美团菜品消耗单物料明细ID
     * @return 美团菜品消耗单物料明细
     */
    @Override
    public MtFoodconsumgoodsitem selectMtFoodconsumgoodsitemById(Long id)
    {
        return mtFoodconsumgoodsitemMapper.selectMtFoodconsumgoodsitemById(id);
    }

    /**
     * 查询美团菜品消耗单物料明细列表
     * 
     * @param mtFoodconsumgoodsitem 美团菜品消耗单物料明细
     * @return 美团菜品消耗单物料明细
     */
    @Override
    public List<MtFoodconsumgoodsitem> selectMtFoodconsumgoodsitemList(MtFoodconsumgoodsitem mtFoodconsumgoodsitem)
    {
        return mtFoodconsumgoodsitemMapper.selectMtFoodconsumgoodsitemList(mtFoodconsumgoodsitem);
    }

    /**
     * 新增美团菜品消耗单物料明细
     * 
     * @param mtFoodconsumgoodsitem 美团菜品消耗单物料明细
     * @return 结果
     */
    @Override
    public int insertMtFoodconsumgoodsitem(MtFoodconsumgoodsitem mtFoodconsumgoodsitem)
    {
        mtFoodconsumgoodsitem.setCreateTime(DateUtils.getNowDate());
        return mtFoodconsumgoodsitemMapper.insertMtFoodconsumgoodsitem(mtFoodconsumgoodsitem);
    }

    /**
     * 修改美团菜品消耗单物料明细
     * 
     * @param mtFoodconsumgoodsitem 美团菜品消耗单物料明细
     * @return 结果
     */
    @Override
    public int updateMtFoodconsumgoodsitem(MtFoodconsumgoodsitem mtFoodconsumgoodsitem)
    {
        mtFoodconsumgoodsitem.setUpdateTime(DateUtils.getNowDate());
        return mtFoodconsumgoodsitemMapper.updateMtFoodconsumgoodsitem(mtFoodconsumgoodsitem);
    }

    /**
     * 批量删除美团菜品消耗单物料明细
     * 
     * @param ids 需要删除的美团菜品消耗单物料明细ID
     * @return 结果
     */
    @Override
    public int deleteMtFoodconsumgoodsitemByIds(Long[] ids)
    {
        return mtFoodconsumgoodsitemMapper.deleteMtFoodconsumgoodsitemByIds(ids);
    }

    /**
     * 删除美团菜品消耗单物料明细信息
     * 
     * @param id 美团菜品消耗单物料明细ID
     * @return 结果
     */
    @Override
    public int deleteMtFoodconsumgoodsitemById(Long id)
    {
        return mtFoodconsumgoodsitemMapper.deleteMtFoodconsumgoodsitemById(id);
    }
}
